<template>
    <div>
        Name: <el-input v-model="name" placeholder="请输入内容"></el-input>
        Age: <el-input v-model="age" placeholder="请输入内容"></el-input>
        <el-button color="#626aef" @click=showInput>show</el-button>
    </div>
</template>

<script lang="ts">

import { ElButton, ElInput } from 'element-plus'
import axios from 'axios';

export default {
    data() {
        return {
            name: '',
            age: '',
            data: ''
        }
    },

    methods: {
        showInput() {
            // 发起 GET 请求
            axios.get('http://114.132.177.40:8080/index/visit')
                .then(response => {
                    console.log(response)
                    alert(response.data)
                })
                .catch(error => {
                    console.error('Error fetching data:', error);
                });

            // 显示提示框而不是仅仅返回字符串

            // alert(`Name: ${this.name} Age: ${this.age}`);
        }
    }
}
</script>

<style scoped>
/* 你可以在这里添加 CSS 样式 */
</style>